import request from '@/utils/request'

export function showNewsList(query) {
  return request({
    url: '/news/show',
    method: 'get',
    params: query
  })
}

export function removeNews(newsId) {
  return request({
    url: '/news/remove',
    method: 'get',
    params: { 'newsId': newsId }
  })
}

export function getNews(newsId) {
  return request({
    url: '/news/get',
    method: 'get',
    params: { 'newsId': newsId }
  })
}

export function saveOrUpdateNews(data) {
  return request({
    url: '/news/save',
    method: 'post',
    data
  })
}

export function toggleDisplay(data) {
  return request({
    url: '/news/display',
    method: 'get',
    params: data
  })
}

export function updateRank(data) {
  return request({
    url: '/news/rank',
    method: 'get',
    params: data
  })
}
